/**
 * 接口统一处理 js
 * */
const install = (Vue, vm) => {
	// 注册
	vm.$api.registrationApi = async (data) => await vm.$u.http.post('/app/common/register', data);
	
	// 用户详情  app/currUser/updateInfo
	vm.$api.currUserDetailApi = async (data) => await vm.$u.http.post('/app/currUser/updateInfo', data);

	// 登录 
	vm.$api.loginApi = async (data) => await vm.$u.http.post('/app/common/login', data);

	// 当前用户信息
	vm.$api.userInfoApi = async (data) => await vm.$u.http.get('/app/currUser/info', data);

	// 我的客服/app-admin/app/currUser/qryCustomerService
	vm.$api.qryCustomerServiceApi = async (data) => await vm.$u.http.get('/app/currUser/qryCustomerService', data);

	// 我的消息/app-admin/app/currUser/qryNotice
	vm.$api.qryMessageApi = async (data) => await vm.$u.http.get('/app/currUser/qryMessage', data);

	// 我的日志/app-admin/app/currUser/log
	vm.$api.currUserLogApi = async (data) => await vm.$u.http.get('/app/currUser/log', data);

	// 登出 /app-admin/app/common/logout
	vm.$api.logOutApi = async (data) => await vm.$u.http.post('/app/common/logout', data);

	// 订单列表  /app-admin/app/orderSale/page
	vm.$api.orderListApi = async (data) => await vm.$u.http.get('/app/orderSale/page', data);

	// 订单详情  /app-admin/app/orderSale/detail
	vm.$api.orderDetailApi = async (data) => await vm.$u.http.get('/app/orderSale/detail', data);

	// 新建订单  /app-admin/app/orderSale/create
	vm.$api.orderCreateApi = async (data) => await vm.$u.http.post('/app/orderSale/createNormal', data);

	// 客户管理列表 /app-admin/app/customer/page
	vm.$api.customerListApi = async (data) => await vm.$u.http.get('/app/customer/page', data);

	// 删除客户	/app-admin/app/customer/delete
	vm.$api.customerDelApi = async (data) => await vm.$u.http.post('/app/customer/delete', data);

	// 客户显示隐藏/app-admin/app/customer/changeStt
	vm.$api.customerChangeSttApi = async (data) => await vm.$u.http.post('/app/customer/changeStt', data);


	// 创建和修改 /app-admin/app/customer/edit
	vm.$api.customerEditApi = async (data) => await vm.$u.http.post('/app/customer/edit', data);


	// 产品删除/app-admin/app/product/delete
	vm.$api.puoductDelApi = async (data) => await vm.$u.http.post('/app/product/delete', data);

	// 创建和编辑 /app-admin/app/product/edit
	vm.$api.productCreateOrEditApi = async (data) => await vm.$u.http.post('/app/product/edit', data);

	// 产品列表	 /app-admin/app/product/page
	vm.$api.productListApi = async (data) => await vm.$u.http.get('/app/product/page', data);

	// 改变产品显隐状态	/app-admin/app/product/changeStt
	vm.$api.productChangeSttApi = async (data) => await vm.$u.http.post('/app/product/changeStt', data);


	// 供应商 删除	/app-admin/app/supplier/delete
	vm.$api.supplierDelApi = async (data) => await vm.$u.http.post('/app/supplier/delete', data);

	// 创建和编辑 /app-admin/app/supplier/edit
	vm.$api.supplierCreateOrEditApi = async (data) => await vm.$u.http.post('/app/supplier/edit', data);

	// 查询价格	/app-admin/app/customer/qryProductInfo
	vm.$api.qryProductInfoApi = async (data) => await vm.$u.http.post('/app/customer/qryProductInfo', data);

	// 供应商列表	 /app-admin/app/supplier/page
	vm.$api.supplierListApi = async (data) => await vm.$u.http.get('/app/supplier/page', data);

	//  图片上传	/app-admin/app/upload/upload
	vm.$api.uploadApi = async (data) => await vm.$u.http.post('/app/upload/upload', data);

	// 创建挂单	 /app-admin/app/orderSale/createTemp
	vm.$api.createSaveApi = async (data) => await vm.$u.http.post('/app/orderSale/createTemp', data);

	// 作废订单	/app-admin/app/orderSale/cancel
	vm.$api.cancelApi = async (data) => await vm.$u.http.get('/app/orderSale/cancel', data);

	// 挂单列表	/app-admin/app/orderSale/pageTemp
	vm.$api.pageTempListApi = async (data) => await vm.$u.http.get('/app/orderSale/pageTemp', data);

	// 挂单详情	/app-admin/app/orderSale/detailTemp
	vm.$api.orderSaleTempListApi = async (data) => await vm.$u.http.get('/app/orderSale/detailTemp', data);


	// 收款列表	/app-admin/app/flowOrderSale/page
	vm.$api.flowOrderSaleListApi = async (data) => await vm.$u.http.get('/app/flowOrderSale/page', data);

	// 添加收款 /app-admin/app/flowOrderSale/create
	vm.$api.flowOrderSaleCreateApi = async (data) => await vm.$u.http.post('/app/flowOrderSale/create', data);

	//收款删除
	vm.$api.flowOrderSaleDeleteApi = async (data) => await vm.$u.http.post('/app/flowOrderSale/delete', data);

	// 收款查询日期范围内统计/app-admin/app/flowOrderSale/saleReportByDay
	vm.$api.saleReportByDayApi = async (data) => await vm.$u.http.post('/app/flowOrderSale/saleReportByDay', data);

	// 收款详情/app-admin/app/flowOrderPurchase/listDetail
	vm.$api.InorderReportDetailApi = async (data) => await vm.$u.http.get('/app/flowOrderSale/orderReportDetail',
		data);

	vm.$api.InorderReportlistDetailApi = async (data) => await vm.$u.http.get('/app/flowOrderPurchase/listDetail',
		data);

	// 付款详情/app/flowOrderPurchase/orderReportDetail 

	vm.$api.purorderReportDetailApi = async (data) => await vm.$u.http.get('/app/flowOrderPurchase/orderReportDetail', data);	
	
	// 付款查询日期范围内统计/app-admin/app/flowOrderPurchase/purReportByDay
	vm.$api.purReportByDayApi = async (data) => await vm.$u.http.post('/app/flowOrderPurchase/purReportByDay', data);
	

	// 收付款删除 /app-admin/app/flowOrderSale/delete
	vm.$api.lowOrderSaleDeleteApi = async (data) => await vm.$u.http.post('/app/flowOrderPurchase/delete', data);

	// 添加付款
	vm.$api.flowOrderPurchaseCreateApi = async (data) => await vm.$u.http.post('/app/flowOrderPurchase/create',
		data);

	// 付款列表	/app-admin/app/flowOrderSale/page
	vm.$api.flowOrderPurchaseListApi = async (data) => await vm.$u.http.get('/app/flowOrderPurchase/page', data);

	//收款删除
	vm.$api.flowOrderPurchaseDeleteApi = async (data) => await vm.$u.http.post('/app/flowOrderPurchase/delete',
		data);

	// 查询日期范围内统计	/app-admin/app/flowOrderPurchase/payReportByDay
	vm.$api.payReportByDayApi = async (data) => await vm.$u.http.get('/app/flowOrderPurchase/payReportByDay', data);

	// 资金报表	/app-admin/app/flowOrderPurchase/payReport
	vm.$api.flowOrderPurchasePayReportApi = async (data) => await vm.$u.http.get('/app/flowOrderPurchase/payReport',
		data);

	// 资金报表详情	/app-admin/app/flowOrderPurchase/orderReportDetail
	vm.$api.flowOrderPurchaseOrderReportDetailApi = async (data) => await vm.$u.http.get(
		'/app/flowOrderPurchase/orderReportDetail', data);

	// 明细 orderSale/orderReportDetail
	vm.$api.orderReportDetailApi = async (data) => await vm.$u.http.get('/app/orderSale/orderReportDetail', data);

	// 客户消费分析	/app-admin/app/dataManage/customerOrderSaleData
	vm.$api.customerOrderSaleDataApi = async (data) => await vm.$u.http.get('/app/dataManage/customerOrderSaleData',
		data);
	// 产品销量分析
	vm.$api.orderReportApi = async (data) => await vm.$u.http.get('/app/dataManage/orderReport', data);
	// 收付款统计
	vm.$api.capitalReportApi = async (data) => await vm.$u.http.get('/app/dataManage/capitalReport', data);


	// 扫条形码		/app-admin/app/common/itemByScan
	vm.$api.itemByScanApi = async (data) => await vm.$u.http.get('/app/common/itemByScan', data);

	// 下载		/app-admin/app/common/init
	vm.$api.initApi = async (data) => await vm.$u.http.get('/app/common/init', data);

	/**
	 * 供应商管理
	 */
	// 新增、编辑 /app-admin/app/supplier/edit
	vm.$api.supplierEdit = async (data) => await vm.$u.http.post('/app/supplier/edit', data);

	// 查询供应商价格		/app-admin/app/customer/qryMaterialInfo
	vm.$api.qryMaterialInfo = async (data) => await vm.$u.http.post('/app/customer/qryMaterialInfo', data);

	/**
	 * 采购管理 
	 */
	// 列表 /app-admin/app/orderPurchase/page
	vm.$api.orderPurchaseList = async (data) => await vm.$u.http.get('/app/orderPurchase/page', data);

	// 采购详情		/app-admin/app/orderPurchase/detail
	vm.$api.orderPurchaseDetailList = async (data) => await vm.$u.http.get('/app/orderPurchase/detail', data);
	// 修改订单的某个产品的参数	/app-admin/app/orderPurchase/detail
	vm.$api.updateOrderDetailApi = async (data) => await vm.$u.http.post('/app/orderPurchase/updateOrderDetail', data);
	// 材料列表 /app-admin/app/orderPurchase/materialPage
	vm.$api.materialPage = async (data) => await vm.$u.http.get('/app/orderPurchase/materialPage', data);

	// /app-admin/app/orderPurchase/create
	vm.$api.orderPurchaseAdd = async (data) => await vm.$u.http.post('/app/orderPurchase/create', data);
	// 对账单
	vm.$api.customerApi = async (data) => await vm.$u.http.post('/app/customer/bill', data);
	// 对账单凭证图片
	vm.$api.detailZipApi = async (data) => await vm.$u.http.post('/app/customer/detailZip', data);
	// 对账单客户订单额的统计
	vm.$api.orderSaleTotalValueApi = async (data) => await vm.$u.http.get('/app/customer/orderSaleTotalValue',
	data);
	// 反馈 添加
	vm.$api.addFeedbackApi = async (data) => await vm.$u.http.post('/app/currUser/addFeedback', data);

	//  隐私注册	/app-admin/app/common/protocol
	vm.$api.protocolApi = async (data) => await vm.$u.http.get('/app/common/protocol', data);
	//  查询公告	
	vm.$api.qryNoticeApi = async (data) => await vm.$u.http.get('/app/currUser/qryNotice', data);
	//  产品置顶
	vm.$api.productSetTopApi = async (data) => await vm.$u.http.get('/app/product/setTop', data);
//  客户置顶
	vm.$api.customerSetTopApi = async (data) => await vm.$u.http.get('/app/customer/setTop', data);
	//  供应商置顶
		vm.$api.supplierSetTopApi = async (data) => await vm.$u.http.get('/app/supplier/setTop', data);
	//产品添加
	vm.$api.checkProductInfoApi = async (data) => await vm.$u.http.post('/app/customer/checkProductInfo', data);
	// 添加时更新价格
	vm.$api.updateProductInfoApi = async (data) => await vm.$u.http.post('/app/customer/updateProductInfo', data);
	// 尺码颜色
	vm.$api.colorAndSizeListApi = async (data) => await vm.$u.http.get('/app/product/colorAndSizeList', data);
	// 添加颜色
	vm.$api.addColorApi = async (data) => await vm.$u.http.get('/app/product/addColor', data);
	// 添加尺寸
	vm.$api.addSizeApi = async (data) => await vm.$u.http.get('/app/product/addSize', data);
	// 子账户列表
	vm.$api.appUserListApi = async (data) => await vm.$u.http.post('/app/currUser/appUserList', data);
	
	// 获取打印标签码		/app-admin/app/orderSale/getPrintSeq
	vm.$api.getPrintSeqtApi = async (data) => await vm.$u.http.post('/app/orderSale/getPrintSeq', data);
	
	// 冻结子账号
	vm.$api.closeUserApi = async (data) => await vm.$u.http.post('/app/currUser/closeUser', data);
	// 解冻子账户
	vm.$api.openUserApi = async (data) => await vm.$u.http.post('/app/currUser/openUser', data);
	// 修改子账户密码
	vm.$api.updateUserPasswordApi = async (data) => await vm.$u.http.post('/app/currUser/updateUserPassword', data);
	// 修改子账户密码
	vm.$api.updateUserApi = async (data) => await vm.$u.http.post('/app/currUser/updateUser', data);
	// 查询系统权限
	vm.$api.qryRightApi = async (data) => await vm.$u.http.get('/app/currUser/qryRight', data);
	// 修改子账户菜单权限
	vm.$api.updateUserRightApi = async (data) => await vm.$u.http.post('/app/currUser/updateUserRight', data);
	// 添加子账户
	vm.$api.addUserApi = async (data) => await vm.$u.http.post('/app/currUser/addUser', data);
	// 修改子账户密码
	vm.$api.updateUserPasswordApi = async (data) => await vm.$u.http.post('/app/currUser/updateUserPassword', data);
}

export default {
	install
}